package com.googlecode.vanaraha.eclipse.preferences
import org.eclipse.core.runtime.preferences.AbstractPreferenceInitializer

class VanarahaPreferenceInitializer extends AbstractPreferenceInitializer{
  override def initializeDefaultPreferences{
    import Activator._
    val store = preferences
    store.setDefault(constant.toolToFindDuplicates, constant.default.toolToFindDuplicates)
    store.setDefault(constant.fileExtension, constant.default.fileExtension)
    store.setDefault(constant.limitMarkerAddition, constant.default.limitMarkerAddition)
    store.setDefault(constant.donotMarkRangeOfLines, constant.default.donotMarkRangeOfLines)
  }
}

class SimianPreferenceInitializer extends AbstractPreferenceInitializer{
  override def initializeDefaultPreferences{
	 import ToolConstants.Simian.{constant, default}
	 val store = Activator.preferences 
	 store.setDefault(constant.balanceCurlyBraces, default.balanceCurlyBraces)
	 store.setDefault(constant.balanceParentheses, default.balanceParentheses)
	 store.setDefault(constant.balanceSquareBrackets, default.balanceSquareBrackets)
	 store.setDefault(constant.ignoreCharacterCase, default.ignoreCharacterCase)
	 store.setDefault(constant.ignoreCharacters, default.ignoreCharacters)
	 store.setDefault(constant.ignoreCurlyBraces, default.ignoreCurlyBraces)
	 store.setDefault(constant.ignoreIdentifiers, default.ignoreIdentifiers)
	 store.setDefault(constant.ignoreIdentifierCase, default.ignoreIdentifierCase)
	 store.setDefault(constant.ignoreModifiers, default.ignoreModifiers)
	 store.setDefault(constant.ignoreNumbers, default.ignoreNumbers)
	 store.setDefault(constant.simianThreshold, default.simianThreshold)
  
  }
}

object ToolConstants{
  object Simian{
	object constant{
		val balanceCurlyBraces    = "simian.balance.curly.braces"
		val balanceParentheses    = "simian.balance.parenthesis"
		val balanceSquareBrackets = "simian.balance.square.brackets"
		val ignoreCharacterCase   = "simian.ignore.character.case"
		val ignoreCharacters	  = "simian.ignore.characters"
		val ignoreCurlyBraces 	  = "simian.ignore.curly.braces"
		val ignoreIdentifiers     = "simian.ignore.identifiers"
		val ignoreIdentifierCase  = "simian.ignore.identifier.case"
		val ignoreModifiers  	  = "simian.ignore.modifiers"
		val ignoreNumbers	  	  = "simian.ignore.numbers"
		val simianThreshold	      = "simian.threshold"
    }
	object default{
		val balanceCurlyBraces    = false
		val balanceParentheses    = false
		val balanceSquareBrackets = false
		val ignoreCharacterCase   = false
		val ignoreCharacters	  = false
		val ignoreCurlyBraces 	  = false
		val ignoreIdentifiers     = false
		val ignoreIdentifierCase  = false
		val ignoreModifiers  	  = false
		val ignoreNumbers	  	  = false
		val simianThreshold		  = 7			
   }
  }
}